# -*- coding: utf-8 -*-
import logging

from rest_framework import serializers

from django_package.application.models import DataFrameModel, TableModel

logger = logging.getLogger(__name__)


class TableRequest(serializers.ModelSerializer):
    class Meta:
        model = TableModel
        fields = '__all__'


class TableResponse(serializers.ModelSerializer):
    class Meta:
        model = TableModel
        fields = '__all__'


class DataFrameSerializer(serializers.Serializer):
    df_code = serializers.CharField(label='编码', )
    df_date = serializers.DateField(label='日期', )


class DataFrameModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = DataFrameModel
        fields = '__all__'


def get_post_check_choice():
    """
    获取动态的选择
    :return:
    """
    choice_list = ['zero', 'one', 'two', 'three']
    return choice_list

# class PostCheckSerializer(serializers.Serializer):
# choice_field = serializers.ChoiceField(choices=get_post_check_choice, )
